package com.wanshi.controller;

import com.wanshi.entity.Cust;
import com.wanshi.entity.Result;
import com.wanshi.service.ICustService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/cust")
public class LIController {

    @Autowired
    private ICustService custService;

    @DeleteMapping("{id}")
    public String shanchu(@PathVariable String id ){


        boolean b = custService.removeById(id);
        if (b){
            return "删除成功";
        }else{

            return "删除失败";
        }
    }


    //根据id进行查询
    @GetMapping("{id}")
    public Cust getbyid(@PathVariable String id){
       return custService.getById(id);

    }

}
